The Java Workshop by David Cuartielles Andreas Göransson & Eric Foster-Johnson

The Java Workshop by David Cuartielles Andreas Göransson & Eric Foster-Johnson

Author:David Cuartielles, Andreas Göransson & Eric Foster-Johnson
Language: eng
Format: epub
Publisher: Packt Publishing Pvt. Ltd.
Published: 2019-09-05T16:00:00+00:00


Exercise 2: Creating an Immutable Class

A local furniture carpenter has set up shop on your street and has asked you to build the storage mechanism for a simple shopping cart application, which they will use internally for people ordering furniture. The application should be able to safely handle multiple people editing it at the same time from different threads. The salespeople will take orders on the phone and the carpenters will be editing the price in hours spent and material used. The shopping cart must be immutable! To do this, perform the following steps:

In the Project pane in IntelliJ, right-click on the folder named src.

Choose New -> Java Class in the menu and enter Exercise2.

Define the main method in your new class:package com.packt.java.chapter13;

public class Exercise2 {



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.